package com.shop.www.model;

import java.util.Objects;

public class Commodity {//商品
    private Integer commodity_ID;
    private String commodity_IMG;
    private String commodity_name;
    private Double price;
    private Integer saleCount;
    private Integer inventory;
    private Integer user_ID;
    private String state;

   private User saller;

    public Commodity(){
    }

    public Commodity(Integer commodity_ID) {
        this.commodity_ID = commodity_ID;
    }

    public Commodity(Integer commodity_ID, String state) {
        this.commodity_ID = commodity_ID;
        this.state = state;
    }


    public Commodity(Integer commodity_ID, String commodity_IMG, String commodity_name, Double price, Integer saleCount, Integer inventory, Integer user_ID,String state) {
        this.commodity_ID = commodity_ID;
        this.commodity_IMG = commodity_IMG;
        this.commodity_name = commodity_name;
        this.price = price;
        this.saleCount = saleCount;
        this.inventory = inventory;
        this.user_ID = user_ID;
        this.state = state;
    }

    public Integer getCommodity_ID() {
        return commodity_ID;
    }

    public void setCommodity_ID(Integer commodity_ID) {
        this.commodity_ID = commodity_ID;
    }

    public String getCommodity_IMG() {
        return commodity_IMG;
    }

    public void setCommodity_IMG(String commodity_IMG) {
        this.commodity_IMG = commodity_IMG;
    }

    public String getCommodity_name() {
        return commodity_name;
    }

    public void setCommodity_name(String commodity_name) {
        this.commodity_name = commodity_name;
    }

    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public Integer getSaleCount() {
        return saleCount;
    }

    public void setSaleCount(Integer saleCount) {
        this.saleCount = saleCount;
    }

    public Integer getInventory() {
        return inventory;
    }

    public void setInventory(Integer inventory) {
        this.inventory = inventory;
    }

    public Integer getUser_ID() {
        return user_ID;
    }

    public void setUser_ID(Integer user_ID) {
        this.user_ID = user_ID;
    }

    public User getSaller() {
        return saller;
    }

    public void setSaller(User saller) {
        this.saller = saller;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof Commodity)) {
            return false;
        }
        Commodity commodity = (Commodity) o;
        return Objects.equals(getCommodity_ID(), commodity.getCommodity_ID()) && Objects.equals(getCommodity_IMG(), commodity.getCommodity_IMG()) && Objects.equals(getCommodity_name(), commodity.getCommodity_name()) && Objects.equals(getPrice(), commodity.getPrice()) && Objects.equals(getSaleCount(), commodity.getSaleCount()) && Objects.equals(getInventory(), commodity.getInventory()) && Objects.equals(getUser_ID(), commodity.getUser_ID()) && Objects.equals(getState(), commodity.getState()) && Objects.equals(getSaller(), commodity.getSaller());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getCommodity_ID(), getCommodity_IMG(), getCommodity_name(), getPrice(), getSaleCount(), getInventory(), getUser_ID(), getState(), getSaller());
    }
}
